package pers.w.chaptertalk.ui.me;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.widget.TextView;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import pers.w.chaptertalk.R;

public class AboutActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);

        final TextView content = findViewById(R.id.tv_about_content);
        content.setMovementMethod(LinkMovementMethod.getInstance());
        String line;
        StringBuilder buffer = new StringBuilder();
        try {
            BufferedReader in = new BufferedReader(new InputStreamReader(getAssets().open("about.txt")));

            while ((line = in.readLine()) != null) {
                buffer.append("\u3000\u3000").append(line).append("\n\n");
            }
            in.close();
        } catch (IOException e) {
          //  e.printStackTrace();
        }
        content.setText(buffer.toString());
    }
}
